package orderoid.singleton;

import orderoid.soap.classeCommune.Restaurant;

public class SingletonRestaurant
{

	private static SingletonRestaurant	instance;
	private Restaurant					restaurant;

	private SingletonRestaurant()
	{
		restaurant = new Restaurant();
	}

	public static SingletonRestaurant getInstance()
	{
		if (instance == null)
		{
			instance = new SingletonRestaurant();
		}

		return instance;
	}

	public Restaurant getRestaurant()
	{
		return restaurant;
	}

	public void setRestaurant(Restaurant restaurant)
	{
		this.restaurant = restaurant;
	}

	public void clearSingletonRestaurant()
	{
		if (this.restaurant != null)
		{
			this.restaurant = null;
		}

		this.restaurant = new Restaurant();
	}
}
